package com.lqwu.mallchatserver.common.constant;

/**
 * RedisKey 常量
 */
public interface RedisKey {
    /**
     * RedisKey 的项目key
     */
    public static final String BASE_KEY = "mallchat:chat";
    /**
     * 用户登录token的key
     */
    public static final String LOGIN_USER_TOKEN = "user:token:uid_%d";
    /**
     * 房间详情
     */
    public static final String ROOM_INFO_STRING = "roomInfo:roomId_%d";
    /**
     * 群组详情
     */
    public static final String GROUP_INFO_STRING = "groupInfo:roomId_%d";
    /**
     * 热门房间列表
     */
    public static final String HOT_ROOM_ZET = "hotRoom";
    /**
     * 用户的信息更新时间
     */
    public static final String USER_MODIFY_STRING = "userModify:uid_%d";

    /**
     * 用户的信息汇总
     */
    public static final String USER_SUMMARY_STRING = "userSummary:uid_%d";
    /**
     * 用户信息
     */
    public static final String USER_INFO_STRING = "userInfo:uid_%d";
    /**
     * 离线用户列表
     */
    public static final String OFFLINE_UID_ZET = "offline";
    /**
     * 在线用户列表
     */
    public static final String ONLINE_UID_ZET = "online";

    /**
     * 根据key和参数生成完整key
     * @param key
     * @param o
     * @return
     */
    public static String getKey(String key,Object... o){
        return BASE_KEY + String.format(key,o);
    }
}
